﻿@{
    ViewBag.Title = "Invest_Show";
    Layout = "~/Views/Shared/MasterView.cshtml";
}
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<link href="~/jindutiao/css/css.css" type="text/css" rel="stylesheet" />
<script src="~/jindutiao/js/jquery.min.js" type="text/javascript"></script>
<link href="~/Content/BootstrapSouce/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/Content/BootstrapSouce/js/jquery.min.js"></script>
<script src="~/Content/BootstrapSouce/js/bootstrap.min.js"></script>
<script type="text/javascript" src="~/_files/jquery-1.8.3.min.js"> </script>
<script type="text/javascript" src="~/_files/jquery.validate.min.js"> </script>
<script type="text/javascript" src="~/Content/ReceptionView/scripts/legacy/JqueryJson.js"></script>
<script type="text/javascript" src="~/_files/com.js?t=201412"></script>
<script type="text/javascript" src="~/_files/jQuery.md5.js"></script>
<script type="text/javascript" src="~/_files/area.js"></script>
<script type="text/javascript" src="~/_files/ceng.js?t=201412"></script>
<script type="text/javascript" src="~/_files/hongling-validate-methods.js"></script>
<link type="text/css" rel="stylesheet" href="https://style.my089.com/pc/themes/base.css?t=20170104">
<link type="text/css" rel="stylesheet" href="https://style.my089.com/pc/themes/ceng.css?t=20170104">
<script type="text/javascript" src="~/_files/jPages.min.js"></script>
<script type="text/javascript" src="~/_files/util.js"></script>
<link rel="stylesheet" type="text/css" href="https://style.my089.com/pc/themes/util.css" />
<script type="text/javascript" src="~/Content/ReceptionView/scripts/common/jquery-jtemplates.js"></script>
<link type="text/css" rel="stylesheet" href="https://style.my089.com/pc/themes/Loan.css?t=20160104">

<script language="javascript">
    function animate() {
        $(".charts").each(function (i, item) {
            var a = parseInt($(item).attr("w"));
            $(item).animate({
                width: a + "%"
            }, 1000);
        });
    }
    animate();
</script>

<script type="text/javascript">

    $(function () {
        Page(1);
    });
    var counttt;
    function Page(pageindex) {
        $.getJSON("/Invest/Invest_Index", {
            pageindexs: pageindex, pagesize: 10,
            huankuantype: $("#huankuanfangshi").val(),
            jiekuanqixianstar: $("#minsid").val(),
            jiekuanqixianend: $("#maxsid").val(),
            biaotype: $("#leixingbiao").val(),
            paixu: $("#paixuing").val()
        }, function (msg) {
            var baifenbi;
            var str = "";

            for (var i = 0; i < msg.Data.length; i++) {
                ////转换时间格式
                var str1 = msg.Data[i].LaunchLoanTime;
                var d = eval('new ' + str1.substr(1, str1.length - 2));

                var ar_date = [d.getFullYear(), d.getMonth() + 1, d.getDate()];
                function dFormat(s) {
                    return s < 10 ? "0" + s.toString() : s;
                }
                for (var s = 0; s < ar_date.length; s++) ar_date[s] = dFormat(ar_date[s]);


                baifenbi = (msg.Data[i].AlreadyRaiseLoan / msg.Data[i].LoanMoney) * 100;
                baifenbi = baifenbi.toString().substring(0, 4);
                str += "<tr>";
                str += "<td><img style='width:50px;height:50px;'  class='img-thumbnail' src='/Content/images/" + msg.Data[i].headimg + "' alt='' /></td><td style='line-height:normal'><a href='/Invest/Invest_One_Show?id=" + msg.Data[i].MemLoanId + "'>" + msg.Data[i].Title + "</a><br/>" + ar_date.join('-') + "|" + msg.Data[i].UserName + "</td><td>" + msg.Data[i].LoanMoney + "</td><td style='line-height:inherit'>" + msg.Data[i].Annualrate + "%/年</td><td>" + msg.Data[i].RepaymentModeId + "</td><td><dl class='barbox' style=' height: 20px;' ><dd class='barline' ><div w='100'   style='width:" + baifenbi + "%' class='charts'></div></dd><dd>" + baifenbi + "%</dd></dl></td>";
                str += "</tr>";
            }
            $("#invest_show").html(str);
            counttt = msg.PageCount;
            var tas = "<tr><td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span> 共<label id='sums'>" + msg.PageCount + "</label>  页 &nbsp&nbsp&nbsp&nbsp当前第 <label id='index'>" + msg.PageIndex + "</label> 页&nbsp&nbsp&nbsp&nbsp <a onclick='Page(1)'>首页</a>&nbsp&nbsp&nbsp&nbsp";
            //判断当前页是否为1，如果不是那就减一如果是那就直接定到第一页
            if (msg.PageIndex <= 1) {
                tas += ("<a  onclick='Page(1)'  >上一页</a>&nbsp&nbsp&nbsp&nbsp");
            }
            else {
                tas += ("<a  onclick='Page(" + (msg.PageIndex - 1) + ")'  >上一页</a>&nbsp&nbsp&nbsp&nbsp");
            }
            //判断是否为最后一页。如果不是那就加一如果是那就直接定到最后一页
            if (msg.PageIndex >= msg.PageCount) {
                tas += "<a  onclick='Page(" + (msg.PageCount) + ")' >下一页</a>&nbsp&nbsp&nbsp&nbsp";
            } else {
                tas += "<a  onclick='Page(" + (msg.PageIndex + 1) + ")' >下一页</a>&nbsp&nbsp&nbsp&nbsp";
            }
            tas += " <a onclick='Page(" + msg.PageCount + ")'>尾页</a>&nbsp&nbsp&nbsp&nbsp";

            //跳转页
            tas += "转到<input id='pageas' style='width:50px;height:28px;' type='text' /><input id='Button22' style='width:50px;height:28px;' class='btn-primary' type='button'  onclick='tiaozhuan()'  value='确定' /></span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</td> </tr>";

            $("#tass").html(tas);
        });
    };
    //跳转分页
    function tiaozhuan() {
        var idd = $("#pageas").val();
        if (idd > counttt) {
            alert("您输入的页数到达极限！为您跳转到尾页");
            Page(counttt);
        } else {
            Page(idd);
        }
    };
    function sousuos() {
        Page(1);
    };

</script>

<div class="height"></div>
<script>
    function s(msg) {
        $("#huankuanfangshi").val(msg); //把还款方式给隐藏
        $("#funding").removeClass();
        $("#funding_0").removeClass();
        $("#funding_2").removeClass();
        $("#funding_3").removeClass();
        if (msg == "") {
            $("#funding").addClass("Current");
        }
        else if (msg == "按月分期") {
            $("#funding_0").addClass("Current");
        }
        else if (msg == "按月到期") {
            $("#funding_2").addClass("Current");
        }
        else if (msg == "按天到期") {
            $("#funding_3").addClass("Current");
        }
        Page(1);
    };
    function qixian(mins, maxs) {
        $("#minsid").val(mins);
        $("#maxsid").val(maxs);
        Page(1);
    };
    function LoanType(msg) {
        $("#loanType").removeClass();
        $("#loanType_1").removeClass();
        $("#loanType_90").removeClass();
        if (msg == "") {
            $("#loanType").addClass("Current");
        }
        else if (msg == "信用标") {
            $("#loanType_1").addClass("Current");
        }
        else if (msg == "净值标") {
            $("#loanType_90").addClass("Current");
        }
        $("#leixingbiao").val(msg);

        Page(1);
    }
    function shengjiangxu(msg) {
        if (msg == "综合") {
            $("#paixuing").val("");
            $("#oc_2").html('金额↓');
            $("#oc_3").html('利率↓');
            $("#oc_4").html('投标进度↓');
        };
        if (msg == "金额") {
            var jine = $("#oc_2").html();
            if (jine == "金额↓") {
                $("#paixuing").val("金额降");
                $("#oc_2").html('金额↑');
            } else {
                $("#oc_2").html('金额↓');
                $("#paixuing").val("金额升");
            }
        };
        if (msg == "利率") {
            var lilv = $("#oc_3").html();
            if (lilv == "利率↓") {
                $("#paixuing").val("利率降");
                $("#oc_3").html('利率↑');
            } else {
                $("#oc_3").html('利率↓');
                $("#paixuing").val("利率升");
            }
        };
        if (msg == "投标进度") {
            var jine = $("#oc_4").html();
            if (jine == "投标进度↓") {
                $("#paixuing").val("投标进度降");
                $("#oc_4").html('投标进度↑');
            } else {
                $("#oc_4").html('投标进度↓');
                $("#paixuing").val("投标进度升");
            }
        };
        Page(1);
    };


    function qixian(mins, maxs) {
        $("#minsid").val(mins);
        $("#maxsid").val(maxs);
        Page(1);
    };
    //function LoanType(msg) {
    //    $("#leixingbiao").val(msg);
    //    Page(1);
    //}
    //function shengjiangxu(msg) {
    //    if (msg == "综合") {
    //        $("#paixuing").val("");
    //        $("#oc_2").html('金额↓');
    //        $("#oc_3").html('利率↓');
    //        $("#oc_4").html('投标进度↓');
    //    };
    //    if (msg == "金额") {
    //        var jine = $("#oc_2").html();
    //        if (jine == "金额↓") {
    //            $("#paixuing").val("金额降");
    //            $("#oc_2").html('金额↑');
    //        } else {
    //            $("#oc_2").html('金额↓');
    //            $("#paixuing").val("金额升");
    //        }
    //    };
    //    if (msg == "利率") {
    //        var lilv = $("#oc_3").html();
    //        if (lilv == "利率↓") {
    //            $("#paixuing").val("利率降");
    //            $("#oc_3").html('利率↑');
    //        } else {
    //            $("#oc_3").html('利率↓');
    //            $("#paixuing").val("利率升");
    //        }
    //    };
    //    if (msg == "投标进度") {
    //        var jine = $("#oc_4").html();
    //        if (jine == "投标进度↓") {
    //            $("#paixuing").val("投标进度降");
    //            $("#oc_4").html('投标进度↑');
    //        } else {
    //            $("#oc_4").html('投标进度↓');
    //            $("#paixuing").val("投标进度升");
    //        }
    //    };
    //    Page(1);
    //};
    //function s(msg) {
    //    $("#funding").removeClass();
    //    $("#funding_0").removeClass();
    //    $("#funding_2").removeClass();
    //    $("#funding_3").removeClass();
    //    if (msg == "") {
    //        $("#funding").addClass("Current");
    //    }
    //    else if (msg == "按月分期") {
    //        $("#funding_0").addClass("Current");
    //    }
    //    else if (msg == "按月到期") {
    //        $("#funding_2").addClass("Current");
    //    }
    //    else if (msg == "按天到期") {
    //        $("#funding_3").addClass("Current");
    //    }
    //    $("#huankuanfangshi").val(msg);
    //    Page(1);
    //};

    //function shengjiangxu(meg) {
    //    $("#oc_5").removeClass();
    //    $("#oc_2").removeClass();
    //    $("#oc_3").removeClass();
    //    $("#oc_4").removeClass();
    //    if (meg == "综合") {
    //        $("#oc_5").addClass("Current");
    //    }
    //    else if (meg == "金额") {
    //        $("#oc_2").addClass("Current");
    //    }
    //    else if (meg == "利率") {
    //        $("#oc_3").addClass("Current");
    //    }
    //    else if (meg == "投标进度") {
    //        $("#oc_4").addClass("Current");
    //    }

    //}
    function qixian(mins, maxs) {
        $("#minsid").val(mins);
        $("#maxsid").val(maxs);
        Page(1);
        $("a[name='qixian']").removeClass();
        if (mins == 0, maxs == 0) {
            $("#life_0").addClass("Current");
        }
        else if (mins == 1, maxs == 30) {
            $("#life_1").addClass("Current");
        }
        else if (mins == 31, maxs == 60) {
            $("#life_2").addClass("Current");
        }
        else if (mins == 61, maxs == 90) {
            $("#life_3").addClass("Current");
        }
        else if (mins == 91, maxs == 180) {
            $("#life_4").addClass("Current");
        }
        else if (mins == 181, maxs == 365) {
            $("#life_5").addClass("Current");
        }
        else if (mins == 366, maxs == 366) {
            $("#life_6").addClass("Current");
        }
    };

</script>
<div class="LoanSelect">
    <div class="Select_warp">
        <div class="Select_list lf">
            <ul>
                <li>
                    <span style=" margin:6px 0;">还款方式：</span><input id="huankuanfangshi" value="" type="hidden" />
                    <a id="funding" href="javascript:void(0);" class="Current" onclick="s('')">全部</a>
                    <a id="funding_0" href="javascript:void(0);" onclick="s('按月分期')">按月分期</a>
                    <a id="funding_2" href="javascript:void(0);" onclick="s('按月到期')">按月到期</a>
                    <a id="funding_3" href="javascript:void(0);" onclick="s('按天到期')">按天到期</a>
                </li>
                <li>
                    <span style=" margin:6px 0;">借款期限：</span><input id="minsid" value="0" type="hidden" /><input id="maxsid" value="0" type="hidden" />
                    <a id="life_0" name="qixian" href="javascript:void(0);" class="Current" onclick="qixian(0,0)">全部</a>
                    <a id="life_1" name="qixian" href="javascript:void(0);" onclick="qixian(1,30)">30天内</a>
                    <a id="life_2" name="qixian" href="javascript:void(0);" onclick="qixian(31, 60)">1-2个月</a>
                    <a id="life_3" name="qixian" href="javascript:void(0);" onclick="qixian(61, 90)">2-3个月</a>
                    <a id="life_4" name="qixian" href="javascript:void(0);" onclick="qixian(91, 180)">3-6个月</a>
                    <a id="life_5" name="qixian" href="javascript:void(0);" onclick="qixian(181, 365)">6-12个月</a>
                    <a id="life_6" name="qixian" href="javascript:void(0);" onclick="qixian(366,366)">12个月以上</a>
                </li>
                <li class="ioc">
                    <span style=" margin:6px 0;">标的类型：</span><input id="leixingbiao" type="hidden" />
                    <a id="loanType" href="javascript:void(0);" class="Current" onclick="LoanType('')">全部</a>
                    <a id="loanType_1" href="javascript:void(0);" onclick="LoanType('信用标')"><span class="SubL1" title="信用标"></span></a>
                    <a id="loanType_90" href="javascript:void(0);" onclick="LoanType('净值标')"><span class="SubL90" title="净值标"></span></a>
                    @*<a id="loanType_50" href="javascript:void(0);" onclick="clickLoanType('loanType_50',50)"><span class="SubL50" title="快借标"></span></a>
                        <a id="loanType_60" href="javascript:void(0);" onclick="clickLoanType('loanType_60',60)"><span class="SubL60" title="推荐标"></span></a>
                        <a id="loanType_110" href="javascript:void(0);" onclick="clickLoanType('loanType_110',110)"><span class="SubL110" title="资产标"></span></a>

                        <a id="loanType_120" href="javascript:void(0);" onclick="clickLoanType('loanType_120',120)"><span class="SubL120" title="公信贷"></span></a>
                        <a id="loanType_130" href="javascript:void(0);" onclick="clickLoanType('loanType_130',130)"><span class="SubL130" title="特定标"></span></a>
                        <a id="loanType_150" href="javascript:void(0);" onclick="clickLoanType('loanType_150',150)"><span class="SubL150" title="议标"></span></a>
                        <a id="loanType_160" href="javascript:void(0);" onclick="clickLoanType('loanType_160',160)"><span class="SubL160" title="承销标"></span></a>*@
                </li>
                <li class="Sort_ioc">
                    <span style=" margin:6px 0;">排序方式：</span><input id="paixuing" type="hidden" />
                    <a id="oc_5" class="Current" onclick="shengjiangxu('综合')" href="javascript:void(0);">综合</a>
                    @*<a id="oc_1" href="javascript:void(0);" onclick="shengjiangxu('期限')">期限<i id='sort1'>↓</i></a>*@
                    <a id="oc_2" href="javascript:void(0);" onclick="shengjiangxu('金额')">金额↓</a>
                    <a id="oc_3" href="javascript:void(0);" onclick="shengjiangxu('利率')">利率↓</a>
                    <a id="oc_4" href="javascript:void(0);" onclick="shengjiangxu('投标进度')">投标进度↓</a>
                </li>
            </ul>
        </div>
        <div class="clear"></div>
    </div>
</div>


<div class="content">

    <table style="background-color:#f6f6f6" class="table table-hover" id="invest_show">
        <tr style="line-height:inherit"></tr>
    </table>
    <table id="tass"></table>
</div>